package com.cy.pj.projects.controller;

import com.cy.pj.common.bo.PageObject;
import com.cy.pj.common.vo.JsonResult;
import com.cy.pj.projects.pojo.PortalProjectVO;
import com.cy.pj.projects.service.PortalProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/*
 * 控制层;
 * */
@RestController
@RequestMapping("/portalproject/")
public class PortalProjectController {
    @Autowired
    private PortalProjectService portalProjectService;

    /* 1.查询分类数据;
     * http://localhost/portalproject/doGetPortalProjectPageObjects
     * */
    @RequestMapping("doGetPortalProjectPageObjects")
    @ResponseBody
    public JsonResult doGetPortalProjectPageObjects(String projectName, Integer pageCurrent) {
        PageObject<PortalProjectVO> pageObject = portalProjectService.getPortalProjectPageObjects(projectName, pageCurrent);
        return new JsonResult(pageObject);      //传入的是data
    }
}
